/**
 * 第三方平台集成API模拟
 */

// 钉钉集成配置模拟
export function getDingtalkConfig() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        data: {
          enabled: true,
          appKey: 'mock_dingtalk_app_key',
          appSecret: 'mock_dingtalk_app_secret',
          agentId: 'mock_dingtalk_agent_id',
          callbackUrl: window.location.origin + '/api/dingtalk/callback'
        }
      })
    }, 300)
  })
}

export function saveDingtalkConfig(config) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({ code: 200, message: '钉钉配置保存成功' })
    }, 500)
  })
}

export function testDingtalkConnection() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({ code: 200, message: '钉钉连接测试成功' })
    }, 1000)
  })
}
